import React, { Component } from 'react'
import { Layout, Menu,  } from "antd";
import { withRouter } from 'react-router-dom' 


const { Header, } = Layout;

class Myheaders extends Component {
    routerSkip=(event)=>{
        // console.log(event)
        const key = event.key
        console.log(key)
        switch (key) {
            case '/nav/personageCenter' :
                this.props.history.push('/nav/personageCenter')
                break;

            case 'keepOut' :
                //GG
                this.props.history.push('/nav/quit')
                break;

            default :
                break;
        }
    }

    render() {
        return (

            <Header className="header" style={{display:'flex'}} >
            <div className="logo" ></div>
            <i style={{color:'#fff',padding:'0  15px' ,fontSize:24, float: 'left'}}>翔瑞金融后台管理</i>
            <span style={{color:'#fff',padding:'0 20px',fontSize:14}}>欢迎：{ JSON.parse(localStorage.getItem('userInfo')).account }</span>
            <img src="" alt="" />
            <Menu theme="dark" mode="horizontal" defaultSelectedKeys={['1']} onClick={ this.routerSkip }>
              <Menu.Item key="/nav/personageCenter">个人中心</Menu.Item>
              <Menu.Item key="keepOut">注销登录</Menu.Item>
            
            </Menu>
          </Header>
        )
    }
}
export default withRouter(Myheaders)
